<?php

	global $wpdb;
	//require_once("packageclass.php");
	//$objPack = new packageClass();
	$table_name =  'wp_spec_authorise';
	$pagename   =  ' Service';
	
	$addme=$_POST["addme"];
	
	if(isset($_REQUEST['submit_service'])){
		
			mysql_query("UPDATE wp_spec_authorise SET `value`='".$_POST['x_login']."' WHERE name = 'x_login'");
			mysql_query("UPDATE wp_spec_authorise SET `value`='".$_POST['x_tran_key']."' WHERE name = 'x_tran_key'");
			mysql_query("UPDATE wp_spec_authorise SET `value`='".$_POST['post_url']."' WHERE name = 'post_url'");
			mysql_query("UPDATE wp_spec_authorise SET `value`='".$_POST['x_type']."' WHERE name = 'x_type'");		
			mysql_query("UPDATE wp_spec_authorise SET `value`='".$_POST['x_version']."' WHERE name = 'x_version'");
			mysql_query("UPDATE wp_spec_authorise SET `value`='".$_POST['x_delim_data']."' WHERE name = 'x_delim_data'");
			mysql_query("UPDATE wp_spec_authorise SET `value`='".$_POST['x_relay_response']."' WHERE name = 'x_relay_response'");
			mysql_query("UPDATE wp_spec_authorise SET `value`='".$_POST['x_method']."' WHERE name = 'x_method'");
			
			
			
		
		}
	
?>


<div class="wrap" style="width:800px;">

<h2 id="add-new-user"> Authorize.net Gateway settings</h2>
				<form class="validate" action="" enctype="multipart/form-data" method="post" id="addtag">
					   <table width="50%" class="form-table">
                    <tbody>
                    <?php 
					
					$query = mysql_query("SELECT * FROM  `wp_spec_authorise`");
			while ($row = mysql_fetch_array($query))
						{
							//$field = $row['name'];
							//echo $$field = $row['value'];
							
						
					 echo'<tr class="form-field">
                        <td scope="row"><label for="'.$row['filed_name'].'">'.$row['filed_name'].'</label></td>
                        <td><input name="'.$row['name'].'" type="text" id="'.$row['filed_name'].'" value="'.$row['value'].'"></td>
                		</tr>';
						}
						
						?>
                        
                        
                       
                        
                   <tr><td>
			  <p class="submit">
						<input type="submit"  value="Update Info" class="button" id="submit" name="submit_service"/>
					</p></td></tr>
                    </table>
                    </tbody>
				</form>

</div>